<template>
  <div>
    <div style="width: 100%;height: 62px;">
      <HeaderMenu></HeaderMenu>
    </div>
    <div style="width: 1420px">
      <div v-if="state" :style="{float:'left',height: height+'px'}">
        <Navigation></Navigation>
      </div>
      <div style="width: 1280px;float:left;">
        <router-view></router-view>
      </div>
    </div>

    <!--    <el-row>-->
    <!--      <el-col :span="4">-->
    <!--        <Navigation ></Navigation>-->
    <!--      </el-col>-->
    <!--      <el-col :span="20">-->

    <!--      </el-col>-->
    <!--    </el-row>-->
  </div>
</template>

<script>
import Navigation from "@/components/Navigation";
import HeaderMenu from "@/components/HeaderMenu";
let windowHeight = parseInt(window.innerHeight+'')
export default {
  name: "Home",
  components: {HeaderMenu, Navigation},
  data() {
    return {
      height: 500,
      state: '',
      timer:false,
      windowHeight:windowHeight,
    }
  },
  mounted() {
    this.init()
  },
  created() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
  },
  destroyed() {
    window.removeEventListener('resize', this.getHeight)
  },
  methods: {
    getHeight() {
      this.height = windowHeight-75;
    },
    init() {
      let t = localStorage.supplierId;
      if (t != null) {
        this.state = true;
        this.$router.push("Product")
      }
      // this.state = this.$route.params.state
      // this.state = localStorage.setItem("state")
    }
  }
}
</script>

<style scoped>

</style>
